﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SpendList.aspx.cs" Inherits="pages_spend_SpendList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>项目列表</title>
    <script type="text/javascript" src="../../scripts/jquery/jquery-1.4.2.js"></script>
    <script type="text/javascript" src="../../scripts/system/member.js"></script>
    <link rel="stylesheet" type="text/css" href="../../css/main.css"/>
    <script type="text/javascript">
        function CusExtWin(visible, id) {
            if (document.layers) {
                theObj = eval("document.layers[\'" + id + "\']");
                if (theObj) {
                    theObj.visibility = visible;
                }
            }
            else if (document.all) {
                if (visible == 'show') visible = 'visible';
                if (visible == 'hide') visible = 'hidden';
                theObj = eval("document.all[\'" + id + "\']");
                if (theObj) {
                    theObj.style.visibility = visible;
                }
            }
        }
        function OnAddNewSpendTypeClick() {
            var newName = document.getElementById("levelName").value;
            if (!newName || newName == "") {
                alert("等级名称不能空");
                return;
            }
            window.navigate("SpendTypeOperation.aspx?action=a&name=" + newName);
        }
        function OnCancleClick() {
            document.getElementById("spendTypeName").value = "";
            CusExtWin('hide', 'boysoft');
        }
    </script>
</head>
<body>
<form id="form1" runat="server">
        <asp:ObjectDataSource ID="SourceSpendItem" runat="server" 
            DataObjectTypeName="SpendItemDetail" DeleteMethod="DeleteEmployees" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="GetEmployees" 
            TypeName="SpendItemDB" UpdateMethod="UpdateEmployees"></asp:ObjectDataSource>
        <asp:ObjectDataSource ID="SourceSpendType" runat="server" 
            DataObjectTypeName="SpendTypeDetail" DeleteMethod="DeleteEmployees" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="GetEmployees" 
            TypeName="SpendTypeDB" UpdateMethod="UpdateEmployees"></asp:ObjectDataSource>
        <table width="730" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td height="34" style="background-image:../../images/bj2.gif"><strong>&nbsp;&nbsp;&nbsp;&nbsp;项目列表</strong></td>
            </tr>
            <tr>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td align="center">
                    <asp:GridView ID="SpendItemGridView" runat="server" AutoGenerateColumns="False" 
                        DataSourceID="SourceSpendItem" AllowPaging="True" BackColor="#DEBA84" 
                        BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
                        CellSpacing="2" DataKeyNames="SpendItemId">
                        <Columns>
                            <asp:BoundField DataField="SpendItemId" HeaderText="SpendItemId" 
                                SortExpression="SpendItemId" Visible="False" />
                            <asp:TemplateField HeaderText="选择">
                                <EditItemTemplate>
                                    <asp:CheckBox ID="DeleteCheckBox" runat="server" />
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="DeleteCheckBox" runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="SpendItemName" HeaderText="消费项目名称" 
                                SortExpression="SpendItemName" >
                            </asp:BoundField>
                            <asp:BoundField DataField="SpendItemPrice" HeaderText="消费项目价格" 
                                SortExpression="SpendItemPrice" />
                            <asp:BoundField DataField="SpendTypeId" HeaderText="SpendTypeId" 
                                SortExpression="SpendTypeId" Visible="False" />
                            <asp:TemplateField HeaderText="消费项目类型" SortExpression="SpendTypeName">
                                <EditItemTemplate>
                                    <asp:DropDownList ID="SpendTypeDropDownList" runat="server" 
                                        DataSourceID="SourceSpendType" DataTextField="SpendTypeName" 
                                        DataValueField="SpendTypeId" SelectedValue='<%# Bind("SpendTypeId") %>'>
                                    </asp:DropDownList>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("SpendTypeName") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="操作" ShowHeader="False">
                                <EditItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" 
                                        CommandName="Update" Text="更新"></asp:LinkButton>
                                    &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                                        CommandName="Cancel" Text="取消"></asp:LinkButton>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                                        CommandName="Edit" Text="编辑"></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
                        <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
                        <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
                        <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
                        <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                        <SortedAscendingCellStyle BackColor="#FFF1D4" />
                        <SortedAscendingHeaderStyle BackColor="#B95C30" />
                        <SortedDescendingCellStyle BackColor="#F1E5CE" />
                        <SortedDescendingHeaderStyle BackColor="#93451F" />
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td align="center">
                    <asp:ImageButton ID="AddNewImageButton" runat="server" 
                        ImageUrl="~/images/an13.gif" 
                        PostBackUrl="~/pages/spend/AddNewSpendItem.aspx" />
                    &nbsp;&nbsp;
                    <asp:ImageButton ID="DeleteImageButton" runat="server" 
                        ImageUrl="~/images/an14.gif" onclick="DeleteImageButton_Click" />
                </td>
            </tr>
            </table>

    <div id="boysoft" style="HEIGHT: 80px; LEFT: 309px; POSITION: absolute; TOP: 150px; VISIBILITY: hidden; WIDTH: 300px; Z-INDEX: 1"> 
      <table bgcolor="#666666" border="1" width="100%" style="height: 80px">
        <tbody> 
            <tr>
                <td height="65" width="100%"> 
                    <table width="99%" style="height: 80px">
                        <tbody> 
                          <tr> 
                            <td>新项目类型名称：</td>
                            <td><input id="spendTypeName" type="text" /></td>
                          </tr>
                          <tr align="center"> 
                            <td height="23" width="100%">
                               <input id="AddSpendTypeButton" onclick="OnAddNewSpendTypeClick()" type="button" value="添加" />
                            </td>
                            <td height="23" width="100%">
                               <input id="CancleLevelButton" onclick="OnCancleClick()" type="button" value="取消" />
                            </td>
                          </tr>
                        </tbody> 
                    </table>
                </td>
            </tr>
        </tbody> 
      </table>
    </div>
    </form>
</body>
</html>
